package demo01;

public class leaf extends Component {
    public leaf() {
    }

    public leaf(String name) {
        super(name);
    }

    @Override
    public void Add(Component component) {
        System.out.println("connt add to a leaf");
    }

    @Override
    public void Remove(Component component) {
        System.out.println("connt remove from leaf");
    }

    @Override
    public void Display(int depth) {
        System.out.println(new String("-")+depth+name);
    }

}
